﻿@model TemplateContext<VideoFrame>

@{
	VideoFrame contextObject = Model.Object;
	
	var origin = Model.Local.Get<Point>("origin");
	var positionStyle = string.Format("left: {0}px; top: {1}px; width: {2}px; height: {3}px;",
										(int)contextObject.X + origin.X,
										(int)contextObject.Y + origin.Y,
										(int)contextObject.Width,
										(int)contextObject.Height);

        int width = (int)contextObject.Width;
        int height = (int)contextObject.Height;

        string videoSrc = VideoHelper.GetVideoURL(contextObject, Model);
        string contentType = contextObject.EmbeddedVideo.ContentType;
}

<table class="table" style="@positionStyle">
    <tr>
        <td>
        <video style="@positionStyle" controls>
            <source src="@videoSrc" type="@contentType">
            Your browser does not support the video tag.
        </video>
        </td>
    </tr>
</table>
